﻿CREATE PROCEDURE [dbo].[yaf_forumaccess_group](
                @GroupID INT)
AS
    BEGIN
        SELECT   a.*,
                 ForumName = b.Name,
                 CategoryName = c.Name
        FROM     yaf_ForumAccess a,
                 yaf_Forum b,
                 yaf_Category c
        WHERE    a.GroupID = @GroupID
        AND b.ForumID = a.ForumID
        AND c.CategoryID = b.CategoryID
        ORDER BY c.SortOrder,
                 b.SortOrder
    END


